﻿@model DoAnWebsite.Models.Ask
@using Ext.Net
@using Ext.Net.MVC
@{
    ViewBag.Title = "Create Question";
    Layout = "~/Views/Shared/_Layout_Admin.cshtml";
}

@section Header
{

}
@section ToolbarSection{
    @Html.X().Button().Text("Lưu").ID("btnSave").Disabled(true).Icon(Icon.Disk).DirectEvents(de =>
            {
                de.Click.Url = Url.Action("CreateQuestion");
                de.Click.EventMask.ShowMask = true;
                de.Click.FormID = "FormPanelCreateQuestion";
            })
           @* *@
    
    @Html.X().Button().Text("Quay lại").Icon(Icon.ArrowLeft).Margins("0 0 0 10").Listeners(ls => ls.Click.Handler = "window.parent.location.reload();parentAutoLoadControl.close();")
}

@Html.X().FormPanel().ID("FormPanelCreateQuestion").Title("Create Question").StyleSpec("position: static; z-index: 10;width: 100%;").Layout(LayoutType.Form).AutoScroll(true).Anchor("100% 100%").Listeners(
ls => ls.ValidityChange.Handler = "App.btnSave.setDisabled(!valid)").Items(
        Html.X().ComboBoxFor(m => m.GroupNewsId).FieldLabel("Group <font color=\"red\">(*)</font>").LabelWidth(130).Items(ViewBag.GQuestionId).Width(800).StyleSpec("margin: 30px;"),
        Html.X().TextFieldFor(m => m.Title).FieldLabel("Title <font color=\"red\">(*)</font>").Width(800).LabelWidth(130).StyleSpec("Margin: 15px 0px 0px 100px"),
        Html.X().HtmlEditorFor(m => m.Content).FieldLabel("Content <font color=\"red\">(*)</font>").Width(800).LabelWidth(130).StyleSpec("Margin: 15px 0px 0px 100px"),
        Html.X().DateFieldFor(m => m.CreateDate).FieldLabel("CreateDate <font color=\"red\">(*)</font>").Width(400).LabelWidth(130).StyleSpec("Margin: 15px 0px 0px 100px"),
        Html.X().TextFieldFor(m => m.AuthorName).FieldLabel("Creator").Width(800).LabelWidth(130).StyleSpec("Margin: 15px 0px 0px 100px"),
        Html.X().TextFieldFor(m => m.Email).FieldLabel("Email").Width(800).LabelWidth(130).StyleSpec("Margin: 15px 0px 0px 100px")
)